//
//  SuperViewVC.m
//  YZZX
//
//  Created by Easaa on 15/3/20.
//  Copyright (c) 2015年 Easaa. All rights reserved.
//

#import "SuperViewVC.h"

@interface SuperViewVC ()

@end

@implementation SuperViewVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    if (Dev_IOSVersion >= 7.0) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
   
    self.view.backgroundColor = [UIColor whiteColor];
}


-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    //修改导航栏的 标题颜色
    [self.navigationController.navigationBar setTitleTextAttributes:
  @{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    
 
    //隐藏导航栏
    //self.navigationController.navigationBarHidden=YES;
    
    self.navigationController.navigationBar.barTintColor = RGBCOLOR(252, 115, 148);
    
    /*
     
    //底层NavigationView
    self.NavigationView  = [[UIView  alloc]init];
    self.NavigationView.frame = CGRectMake(0, 0, Dev_ScreenWidth, 64);
    self.NavigationView.backgroundColor = RGBCOLOR(252, 115, 148);
    //[self.view addSubview:self.NavigationView];
   
    
    
    
    //标题
    self.NavLableTitle = [[UILabel alloc]initWithFrame:CGRectMake(Dev_ScreenWidth/2-100/2, 64-44, 100, 44)];
    //self.NavLableTitle.backgroundColor = [UIColor redColor];
    self.NavLableTitle.textColor = [UIColor whiteColor];
    self.NavLableTitle.textAlignment = NSTextAlignmentCenter;
    [self.NavigationView addSubview:self.NavLableTitle];
    //self.NavLableTitle.text = self.title;
    
 
    
    //返回按钮
    self.NavBack = [UIButton buttonWithType:UIButtonTypeCustom];
    self.NavBack.frame = CGRectMake(0, 64-44, 50, 44);
    [self.NavBack setImage:[UIImage imageNamed:@"top_navgation_back@2x"] forState:UIControlStateNormal];
    [self.NavBack setImage:[UIImage imageNamed:@"top_navgation_back@2x"] forState:UIControlStateHighlighted];

    [self.NavBack addTarget:self action:@selector(NavBackButseletor) forControlEvents:UIControlEventTouchUpInside];    
     UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:self.NavBack];
    self.navigationItem.leftBarButtonItem = backItem;
  
    
    
    //右边导航按钮
    self.NavBut = [UIButton buttonWithType:UIButtonTypeCustom];
    self.NavBut.frame = CGRectMake(Dev_ScreenWidth-100, 64-44, 50, 44);
    [self.NavBut setImage:[UIImage imageNamed:@"top_navgation@2x"] forState:UIControlStateNormal];
    [self.NavBut setImage:[UIImage imageNamed:@"top_navgation@2x"] forState:UIControlStateHighlighted];
    [self.NavBut setBackgroundColor:[UIColor greenColor]];
    
    [self.NavBut addTarget:self action:@selector(NavButseletor) forControlEvents:UIControlEventTouchUpInside];
    //[self.NavigationView addSubview:self.NavBut];
   
    
    
    //右边菜单按钮
    
    self.NavButMenu = [UIButton buttonWithType:UIButtonTypeCustom];
    self.NavButMenu.frame = CGRectMake(Dev_ScreenWidth-50, 64-44, 50, 44);
    [self.NavButMenu setImage:[UIImage imageNamed:@"top_more@2x"] forState:UIControlStateNormal];
    [self.NavButMenu setImage:[UIImage imageNamed:@"top_more@2x"] forState:UIControlStateHighlighted];
    
    [self.NavButMenu setBackgroundColor:[UIColor redColor]];
    [self.NavButMenu addTarget:self action:@selector(ButMenuBseletor) forControlEvents:UIControlEventTouchUpInside];
    //[self.NavigationView addSubview:self.NavButMenu];

    
    */
    
    
    //返回按钮
    self.NavBack = [UIButton buttonWithType:UIButtonTypeCustom];
    self.NavBack.frame = CGRectMake(0, 64-44, 50, 44);
    [self.NavBack setImage:[UIImage imageNamed:@"top_navgation_back@2x"] forState:UIControlStateNormal];
    [self.NavBack setImage:[UIImage imageNamed:@"top_navgation_back_h@2x"] forState:UIControlStateHighlighted];
    
    [self.NavBack addTarget:self action:@selector(NavBackButseletor) forControlEvents:UIControlEventTouchUpInside];
    
    

    
    UIBarButtonItem *negativeSpacerLeft = [[UIBarButtonItem alloc]
                                            
                                            initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                            
                                            target:nil action:nil];
    
    /**
     
     *  width为负数时，相当于btn向右移动width数值个像素，由于按钮本身和边界间距为5pix，所以width设为-5时，间距正好调整
     
     *  为0；width为正数时，正好相反，相当于往左移动width数值个像素
     
     */
    
    negativeSpacerLeft.width = -15;
    
    UIBarButtonItem *leftBarBtItem = [[UIBarButtonItem alloc] initWithCustomView:self.NavBack];
    
    self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:negativeSpacerLeft, leftBarBtItem, nil];
    
//    
//    
//    
//    
//    self.RefreshBut = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.RefreshBut.frame = CGRectMake(Dev_ScreenWidth-50, 64-44, 50, 44);
//    [self.RefreshBut setImage:[UIImage imageNamed:@"top_more@2x"] forState:UIControlStateNormal];
//    [self.RefreshBut setImage:[UIImage imageNamed:@"top_more@2x"] forState:UIControlStateHighlighted];
//    // self.RefreshBut.hidden =YES;
//    
//    [self.RefreshBut addTarget:self action:@selector(ButMenuBseletor) forControlEvents:UIControlEventTouchUpInside];
//    
//    
//    UIBarButtonItem *negativeSpacerRight = [[UIBarButtonItem alloc]
//                                            
//                                            initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
//                                            
//                                            target:nil action:nil];
//    
//    /**
//     
//     *  width为负数时，相当于btn向右移动width数值个像素，由于按钮本身和边界间距为5pix，所以width设为-5时，间距正好调整
//     
//     *  为0；width为正数时，正好相反，相当于往左移动width数值个像素
//     
//     */
//    
//    negativeSpacerRight.width = -15;
//    
//    UIBarButtonItem *rightBarBtItem = [[UIBarButtonItem alloc] initWithCustomView:self.RefreshBut];
//    
//    self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:negativeSpacerRight, rightBarBtItem, nil];
//    
    

    
    
    
 }


// 返回键执行时事件
-(void)NavBackButseletor
{

    [self.navigationController popViewControllerAnimated:YES];




}

//导航BUT事件
- (void)NavButseletor
{
    
    // [self.navigationController pushViewController:<#(UIViewController *)#> animated:<#(BOOL)#>]
    
    
    
    
}

//左上角菜单BUT执行事件
- (void)ButMenuBseletor
{
    
    
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
